<?php
include("config.php");

if(isset($_REQUEST['id'])){
	$id = $_REQUEST['id'];
	$addsql = "id = $id";
}else{
	$addsql = "1";
}

//'0=未发货，1=已发货，2=已收货，4=退货中，5=已退货'

$sql = "select * from orders where $addsql";
$ret = $mysql->query($sql);
$orderinfo = $mysql->fetch_array($ret);
$orderinfo = $orderinfo[0];
//print_r('<pre>');print_r($orderinfo);

?>

<HTML>
<HEAD>
<TITLE>淘宝小赢家-订单系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<link rel="stylesheet" href="images/FONT.css" type="text/css">
<SCRIPT language=javascript src="jquery-1.2.1.pack.js"></SCRIPT>
</head>
<body text="#000000">
<form name="fom" id="fom" method="post" action="actOrder.php">
<table cellpadding=0 cellspacing=0 width=100% class="role_table" >
<tbody>
<tr>
    <td class="tRight" width="70px"> 编号:</td>
	<td class="tLeft" ><?php echo $orderinfo['id'];?>&nbsp;</td>	
	<td class="tRight" width="70px">订单编号:</td>
	<td class="tLeft" ><?php echo $orderinfo['order_id'];?>	</td>
</tr>
<tr>
	<td class="tRight" width="70px">产品名:</td>
	<td class="tLeft" colspan="3" ><?php echo $orderinfo['good_name'];?></td>
</tr>
<tr>
	<td class="tRight" width="70px">购买数量:</td>
	<td class="tLeft" ><?php echo $orderinfo['good_num'];?></td>
      <td class="tRight" width="70px">金额:</td>
	<td class="tLeft" ><?php echo $orderinfo['price'];?>&nbsp;</td>
</tr>
</tr>
<tr>
	<td class="tRight" width="70px">收货人:</td>
	<td class="tLeft" ><?php echo $orderinfo['receiver_name'];?></td>
    <td class="tRight" width="70px">联系电话:</td>
	<td class="tLeft" ><?php echo $orderinfo['tel'];?></td>
</tr>
<tr>
	<td class="tRight" width="70px">联系手机:</td>
	<td class="tLeft" ><?php echo $orderinfo['phone'];?></td>
    <td class="tRight" width="70px">QQ号码:</td>
	<td class="tLeft" ><?php echo $orderinfo['qq'];?></td>
</tr>
<tr>
	<td class="tRight" width="70px">发货地址:</td>
	<td class="tLeft"  ><?php echo $orderinfo['address'];?></td>
     <td class="tRight" width="70px">Email:</td>
	<td class="tLeft" ><?php echo $orderinfo['email'];?></td>
</tr>

<tr>
	<td class="tRight" width="70px">备注说明:</td>
	<td class="tLeft"><?php echo $orderinfo['comments'];?></td>
    <td class="tRight" width="70px">邮    编:</td>
	<td class="tLeft"  ><?php echo $orderinfo['code'];?></td>
</tr>
<tr>
	<td class="tRight">来路地址:</td>
	<td class="tLeft"><?php echo $orderinfo['refer'];?></td>
      <td class="tRight" width="70px">IP地址:</td>
	<td class="tLeft" ><?php echo $orderinfo['ip'];?>&nbsp;&nbsp;
	<a href="http://ip138.com/ips.asp?ip=<?php echo $orderinfo['ip'];?>&action=2" target="_blank"><font color='red'>点击查看归属地</font></a></td>
</tr>
<tr>
	<td class="tRight">下单页面:</td>
	<td class="tLeft" ><?php echo $orderinfo['order_page'];?></td>
    <td class="tRight" width="70px">下单时间:</td>
	<td class="tLeft" ><?php echo $orderinfo['order_time'];?></td>
</tr>
<tr>
	<td class="tRight">送货时间:</td>
	<td class="tLeft" ><?php echo $orderinfo['delivery_time'];?></td>
    <td class="tRight" width="70px">付款方式:</td>
	<td class="tLeft" ><?php echo $orderinfo['pay_type'];?></td>
</tr>
<tr>
	<td class="tRight" width="70px">发货状态:</td>
	<td class="tLeft"><select id="status" name="status" style="font-size:9pt">
      <option value="0" >未处理</option>
      <option value="1" >电话已确认</option>
      <option value="2" >电话不通</option>
      <option value="3" >取消订购</option>
      <option value="4" >已发货</option>
      <option value="5" >其它原因</option>
    </select></td>
    <td class="tRight" width="70px">在线支付:</td>
	<td class="tLeft" ><?php echo $orderinfo['pay_online'];?></td>
</tr>
<tr>
	<td class="tRight">管理员备注:</td>
	<td class="tLeft" colspan="3">
		<textarea name="log" cols="30" rows="3" id="log">
			<?php echo $orderinfo['log'];?>
		</textarea>		
	</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td class="center" colspan="3">
	<input type="hidden" name="id" value="<?php echo $orderinfo['id'];?>">
	<input type="hidden" name="act" value="update">
	<input type="submit" value="保 存"  name="submit" class="button small"> 
	<input type="reset" class="button small" onClick="window.location='orderlist.php'" value="返 回" ></td>
</tr>
</tbody>
</table>
</form>
<script>
	var status = "<?php echo $orderinfo['status'];?>";
	$("option[value=" + status + "]").attr("selected",'true')
</script>
</body>
</html>